﻿<!-- "script/apps/Aries/Creator/Game/Tasks/Friend/AddFriendsPage.html" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
<pe:mcml>
<script refresh="true" type="text/npl" src="AddFriendsPage.lua"><![CDATA[
local AddFriendsPage = NPL.load("(gl)script/apps/Aries/Creator/Game/Tasks/Friend/AddFriendsPage.lua");
AddFriendsPage.OnInit()
function ClosePage()
    Page:CloseWindow(0)
    AddFriendsPage.CloseView()
end
function OnChange(index)
    AddFriendsPage.OnChange(index);
end
function IsSelected(index)
    return AddFriendsPage.index == index;
end
function DS_Items(index)
    if(index == nil) then
        return #AddFriendsPage.Current_Item_DS;
    else
        return AddFriendsPage.Current_Item_DS[index];
    end
end
function ClickItem(index)
    AddFriendsPage.ClickItem(index)
end

function GetTimeDesc(time)
    return AddFriendsPage.GetTimeDesc(time)
end

function SearchFriend()
    local search_ctrl = Page:FindUIControl("block_search_text_ctl")
    AddFriendsPage.SearchFriend(search_ctrl.text)
end

function GetIcon(data)
    return AddFriendsPage.GetIcon(data)
end

function GetFansBtText(data)

    return AddFriendsPage.GetFansBtText(data)
end

function Follow(data)
    AddFriendsPage.ToFollow(data.id)
end

function ClickItem()
end

function CanClick(data)
    return not AddFriendsPage.IsFollow(data.id)
end

function OnSearch()
    if(virtual_key == Event_Mapping.EM_KEY_RETURN) then
        SearchFriend()
	end
end

function GetNmae(data)
	local name = data.nickname or data.username
	name = name or ""
    return name
end

function ClickHead(name, mcmlNode)
    local data = mcmlNode:GetAttribute("param1")
    local user_page = NPL.load("(gl)Mod/GeneralGameServerMod/App/ui/page.lua");
    user_page.ShowUserInfoPage({username=data.username});
end
]]></script>
<kp:window name="iframe" mode="lite" width="560" height="207" title='<%= L"添加好友"%>' onclose="ClosePage">
    <div style="color:#ffffff;padding-left:2px;padding-top:39px;padding-right:2px;padding-bottom:2px;">

    <div style="margin-left:33px;margin-top:5px;width:560;">
        <div style="float: left;width:440;height:26px;background:url(Texture/Aries/Creator/keepwork/friends/sousuo_16X16_32bits.png#0 0 16 16:4 4 4 4);">
            <input type="text" EmptyText='<%=L"搜索: 输入对方账号、昵称或手机"%>' name="block_search_text_ctl" uiname="block_search_text_obj" CaretColor="#FFFFFFFF" style="margin-left:5px;textcolor:#dedede;wid;height:25px;background:;" onkeyup="OnSearch" />
        </div>

        <input type="button" value='搜索' onclick="SearchFriend" tooltip="搜索" style="float: left;color: #000000;margin-left: -7; margin-top: 0;font-size: 14pt;width: 55;height: 27; background:url(Texture/Aries/Creator/keepwork/friends/btn_shousuo_36X28_32bits.png#0 0 32 32:8 8 8 8)" />
    </div>

    <div type ="box" style="width:560;height:140">
           <div style="margin-top:0px;">
            <pe:gridview style="margin:0px;width:560;height:140;" name="item_gridview" CellPadding="12" VerticalScrollBarStep="36" VerticalScrollBarOffsetX="8" AllowPaging="false" ItemsPerLine="1" DefaultNodeHeight = "35" 
                DataSource='<%=DS_Items%>'>
	            <Columns>
                        <div style="color:#ffffff">
                            <a style="width:550;height:45px;margin:0px;padding:0px;background:;"
                               onclick="ClickItem" param1='<%=Eval("nid")%>'>
                                <input type="button" Normal_BG="" onclick="ClickItem" param1='<%= XPath("this") %>' MouseOver_BG='' alwaysmouseover="true" style="position:relative;margin-top:0px;width:550px;height:45px;background:;" />
                                <div style="position:relative;margin-left:10px;margin-top:0px;padding-left:5px;padding-top:2px;width:550px;height:30px;">
                                    <!-- <a width="32" height="26" style="padding-left:0px;padding-top:2px;background:;"
                                       onclick="ClickItem" param1='<%=Eval("nid")%>'>
                                        <aries:onlinestatus width="550" height="26" nid='<%=Eval("nid")%>' />
                                    </a> -->
                                    <div style="float: left;margin-left:0px;margin-top:0px;">
                                        <img zorder="0" src='<%=GetIcon(XPath("this"))%>'width="46" height="46" onclick="ClickHead" param1='<%= XPath("this") %>'/>
                                    </div>
                                    <div onclick="ClickHead" param1='<%= XPath("this") %>' style="float: left;margin-left:16px;margin-top:8px;width:120px;color:#000000">
                                        <%=GetNmae(XPath("this")) %>
                                    </div>
                                    <div style="float: left;margin-left:267px;margin-top:10px;font-size:12pt;color:#000000;text-align: right;">
                                        <!-- <pe:if condition='<%=CanClick(XPath("this"))%>'>
                                            
                                        </pe:if> -->
                                        <input type="button" value='<%= GetFansBtText(XPath("this"))%>' onclick="Follow" name='<%= XPath("this") %>' tooltip='<%= GetFansBtText(XPath("this"))%>' style="color: #000000; width: 52;height: 27; font-size: 14;background: url(Texture/Aries/Creator/keepwork/friends/btn_guanzhu_32X32_32bits.png#0 0 32 32:8 8 8 8);"/>
                                        <!-- <pe:if condition='<%=not CanClick(XPath("this"))%>'>
                                            <input type="button" value='<%= GetFansBtText(XPath("this"))%>' enabled='false' onclick="Follow" name='<%= XPath("this") %>' tooltip='<%= GetFansBtText(XPath("this"))%>' style="color: #000000; width: 52;height: 27; font-size: 14;background: url(Texture/Aries/Creator/keepwork/friends/btn_guanzhu_32X32_32bits.png#0 0 32 32:8 8 8 8);"/>
                                        </pe:if> -->
                                    </div>
                                </div>
                            </a>
                        </div>
                </Columns>
	            <EmptyDataTemplate>
	            </EmptyDataTemplate>
            </pe:gridview>
        </div>
    </div>
</div>
    
</aries:window>
</pe:mcml>
</body>
</html>

